package com.happle.gcmclient.adapter;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.happle.gcmclient.R;
import com.happle.gcmclient.obj.LngObj;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Inna on 16.11.13.
 */
public class SpinnerLngAdapter extends ArrayAdapter<String> {
    private String TAG = "SettingsLngAdapter.java";
    private Context context;
    private String[] itemList;
    private LayoutInflater inflater;

    public SpinnerLngAdapter(Context context, int textViewResourceId,String[] items)
    {
        super(context, textViewResourceId);
        this.context=context;
        this.itemList=items;
        inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View row = inflater.inflate(R.layout.simple_spinner_item, parent,
                false);
        TextView v = (TextView) row.findViewById(android.R.id.text1);
        v.setText(itemList[position]);
        return row;
    }
    @Override
    public View getDropDownView(int position, View convertView,
                                ViewGroup parent) {
        View row = inflater.inflate(R.layout.simple_spinner_item, parent,
                false);
        TextView v = (TextView) row.findViewById(android.R.id.text1);
        v.setText(itemList[position]);
        v.setTextSize(20);
        v.setTextColor(context.getResources().getColor(R.color._blue));
        v.setText(itemList[position]);
        return row;
    }
}
